<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <template v-if="seen">

            <h1 >标题</h1>
            <p >段落文本</p>
        </template>
        <ul>
            <template v-if="seen">
                <li>1</li>
                <li>2</li>
                <li>3</li>
            </template>
            <!-- <template v-show="other"> -->
                <li v-show="other">4</li>
                <li v-show="other">5</li>
            <!-- </template> -->
        </ul>
        <div>
            <p v-for="(v, k,i) in student">{{i}},{{k}},{{v}}</p>
        </div>
        <div>
            <p v-for="i in 10">{{i}}</p>
        </div>
        <input type="button" value="OK" @click.once="handleClick(100)">
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.10/dist/vue.js"></script>
    <script>

        let app = new Vue({
            el:"#app",
            data:{
                seen:false,
                other:false,
                student:{
                    name:"张飞",
                    age:20,
                    gender:"男"
                }
            },
            methods:{
                handleClick(param){
                    console.log("click",param)
                }
            }
        });
    </script>
</body>
</html>